"""
player factory
"""
from common.const import PlayerType
from common.log import logger


def create_bot(player_type, output_queue):
    """
    create a player_type instance
    :param player_type: player type code
    :return: player instance
    """
    if player_type == PlayerType.PYAUDIO:
        from voice.player.pyaudio.pyaudio_player import PyAudioPlayer
        return PyAudioPlayer(output_queue)
    logger.error("not player type!")
    raise RuntimeError
